package agenti;

import jade.core.AID;
import jade.core.Agent;
import jade.core.behaviours.Behaviour;
import jade.lang.acl.ACLMessage;
import jade.wrapper.ControllerException;
import jade.wrapper.StaleProxyException;

public class PausaSimulazione extends Agent {

	@Override
	protected void setup() {
		super.setup();
		addBehaviour(new Pausa());
	}

	private class Pausa extends Behaviour {

		@Override
		public void action() {
			ACLMessage msg = new ACLMessage(ACLMessage.REQUEST);
			msg.setContent("pausa");
			msg.addReceiver(new AID("Produttore", AID.ISLOCALNAME));
			msg.addReceiver(new AID("Consumatore", AID.ISLOCALNAME));
			send(msg);

		}

		@Override
		public boolean done() {
			doDelete();
			return false;
		}

	}
}
